package edu.cuit.zhuyimeng.aircraft.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 飞机状态枚举类
 */
@AllArgsConstructor
@Getter
public enum AircraftStatus {

    IDLE(1,"空闲"),
    BUSY(2,"使用中"),
    MAINTAIN(3,"维护中");

    private final Integer type;
    private final String name;

    public static AircraftStatus getByType(Integer type) {
        for (AircraftStatus value : values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }
}
